package goleetcode

import "sort"

func maxArea(h int, w int, horizontalCuts []int, verticalCuts []int) int {
	sort.Ints(horizontalCuts)
	sort.Ints(verticalCuts)
	return help(horizontalCuts, h) * help(verticalCuts, w) % 1e+7
}

func help(arr []int, boarder int) int {
	res, pre := 0, 0
	for _, i := range arr {
		res = max(i-pre, res)
		pre = i
	}
	return max(res, boarder-pre)
}